package com.zhao.dome01.mapper;

import com.zhao.dome01.pojo.dto.CosPlayerEnrollDto;
import com.zhao.dome01.pojo.entry.CosPlayer;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CosPlayerMapper {

    /**
     * 接收来自前端注册的信息
     *
     */
    @Insert("insert into dome01.cos_player (username,name,password,enroll_time) " +
            "value (#{username},#{name},#{password},#{enrollTime})")
    void insert(CosPlayerEnrollDto cosPlayerEnrollDto);

    /**
     * 通过查询
     * 我就是个傻逼  这里忘记查询条件了  结果半天找不到错误
     */
    @Select("select id, username, name, password, gender, email, phone, enroll_time from dome01.cos_player " +
            "where username = #{username}")
    CosPlayer selectByUsername(String username);
}
